package com.zcl.proxy;

import com.zcl.dao.UserDao;
//代理对象,静态代理,都需要实现接口的所有方法
public class UserDaoStaticImpl implements UserDao {
    private UserDao userDao;
    public UserDaoStaticImpl(UserDao userDao){
       this.userDao= userDao;
    }
    @Override
    public void add() {
        userDao.add();
    }

    @Override
    public void delete() {
        userDao.delete();
    }

    @Override
    public void update() {
        userDao.update();
    }

    @Override
    public void search() {
        cheat();
        userDao.search();
    }
    public void cheat(){
        System.out.println("执行前的检查");
    }
}
